{extend name="base" /}
{block name="css"}
<link rel="stylesheet" type="text/css" href="__STATIC__/plugins/mmgrid/mmGrid.css?v={$v}" />
{/block}
{block name="js"}
<script src="__ADMIN__/addons/addons.js?v={$v}" type="text/javascript"></script>
{/block}
{block name="main"}
<div class="layui-tab layui-tab-brief" lay-filter="msgTab">
      <ul class="layui-tab-title">
            <li class="layui-this">已安装</li>
            <li>未安装</li>
      </ul>
      <div class="layui-tab-content addons" style="padding: 10px 0;">
            <div class="layui-tab-item layui-show">
                <div class="qy">已启用<span style="color:red;font-weight:bold;">&nbsp;&nbsp;(安装插件后，进入“设置”，填写配置信息，然后点击保存！)</span></div>
                <ul><div id='addonsBox1'></div></ul>
                <div class="qy">未启用</div>
                <ul><div id='addonsBox2'></div></ul>
            </div>
            <div class="layui-tab-item">
                <ul><div id='addonsBox0'></div></ul>
                <div style='text-align:center' id='pager'></div>
            </div>
      </div>
</div>
<script id="addonsTpl" type="text/html">
      {{# for(var i = 0; i < d['data'].length; i++){ }}
      <li {{# if(d['addonStatus']==2){}}class="no_use"{{#}}}>
            <div class="cimg"><img src="__ROOT__/addons/{{d['data'][i].name.toLowerCase()}}/logo.png"></div>
            <div class="ctxt">
                  <h3>{{d['data'][i].title}}</h3>
                  <p title='{{d['data'][i].description}}'>{{d['data'][i].description}}</p>
            </div>
            <div class="cbtn">
                  {{# if(WST.GRANT.CJGL_01 && d['data'][i]['status']>0 && d['data'][i]['isConfig']==1){}}
                  <a href="{{WST.U('admin/Addons/toEdit','id='+d['data'][i]['addonId'])}}">设置</a>
                  {{#}}}
                  {{# if(WST.GRANT.CJGL_02 && d['data'][i]['status']==0){}}
                  <a href="javascript:install({{d['data'][i]['addonId']}})">安装</a>
                  {{#}}}
                  {{# if(WST.GRANT.CJGL_04 &&  d['data'][i]['status']==2){}}
                  <a href="javascript:enable({{d['data'][i]['addonId']}})">启用</a>
                  {{#}}}
                  {{# if(WST.GRANT.CJGL_05 && d['data'][i]['status']==1){}}
                  <a href="javascript:disable({{d['data'][i]['addonId']}})" class="xiez">禁用</a>
                  {{#}}}
                  {{# if(WST.GRANT.CJGL_03 && d['data'][i]['status']>0){}}
                  <a href="javascript:uninstall({{d['data'][i]['addonId']}})" class="xiez">卸载</a>
                  {{#}}}
            </div>
      </li>
      {{# } }}
</script>
{/block}
